package com.example.demo.controller.admin;

import com.alibaba.fastjson.JSONObject;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AdminController {
    /**

     *
     * @return
     */
    @Secured("ROLE_INDEX")
    @RequestMapping("/admin/index")
    public String admin(){
        return "redirect:index.html";
    }

    @Secured("ROLE_GOODS")
    @GetMapping("/admin/goods")
    public String goods(){
        return "redirect:goods.html";
    }


    @Secured("ROLE_role")
    @GetMapping("/admin/role")
    public String role(){
        return "redirect:role.html";
    }



}
